<?php

/**
 * Framework_Util_Debug
 *
 * A Debugging Utility
 *
 * @author Application Support Group
 * @copyright University of Georgia
 * @package BAMF
*/
class Framework_Util_Debug extends Framework_Object {


	public function __construct() {
		parent::__construct();
	}

	/**
	 * show
	 *
	 * Wrap print_r output in &lt;pre&gt; tags
	 *
	 * @param	$info	The variable, array, or object to pass to print_r()
	 * @param	$die	Whether to issue die() when finished.  Defaults to true.
	 */
	static public function show( $info, $die=true ) {
		print "<pre>" ;
		print_r( $info ) ;
		print "</pre>" ;

		if( $die ) { 
			die() ; 
		}
	}

	/**
	 * toString
	 *
	 * Like show(), but uses print() instead.  Useful with objects
	 * that have __toString() defined.
	 *
	 * @param	$info	The variable, array, or orbject to pass to print()
	 * @param	$die	Whether to issue die() when finished.  Defaults to true.
	 */ 
	static public function toString( $info, $die=true ) {
		print "<pre>" ;

		if( is_array( $info )) {
			foreach( $info as $i ) { 
				print $i ; 
			}
		}else {
			print $info ; 
		}

		print "</pre>" ;

		if( $die ) { 
			die() ; 
		}
	}

	public function __destruct() {
		parent::__destruct();
	}
}

?>
